#ifndef SERVERWINDOW_H
#define SERVERWINDOW_H

#include <QObject>
#include <QWidget>
#include <QMainWindow>
#include <QToolBar>
#include <QMenu>
#include <QMenuBar>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QString>
#include <QFileDialog>
#include <QPixmap>
#include <string>

#include "../Common/GlobalError.h"
#include "../Common/Song.h"
#include "../Common/Playlist.h"
#include "../Common/PlaylistWidget.h"

#include "PlaylistServer.h"
#include "MulticastServer.h"

/*-------------------------------------------------------------------------------------------
--
--	CLASS: ServerWindow
--
--	Date: March 22, 2010
--
--	REVISIONS (Date and Description):
--
--	DESIGNER: Erick Ribeiro
--
--	PROGRAMMER: Erick Ribeiro
--
--  INTERFACE: class ServerWindow : public QMainWindow
--
--  RETURNS: N/A
--
--	NOTES: Program class for the Server window GUI. Handles the layout, menu items, and
--         other GUI related functions.
--
-------------------------------------------------------------------------------------------*/
class ServerWindow : public QMainWindow
{
Q_OBJECT

public:
    ServerWindow (QWidget * parent = 0);

public slots:
    void startServer ();
    void addSong ();
    void micToggled();
    void playlistToggled();

private:
    bool serverIsRunning;

    PlaylistServer  * playlistServer;
    MulticastServer * streamServer;

    QToolBar * toolBar;
    QAction  * micAction;
    QAction  * playlistAction;

    QMenu   * serverMenu;
    QAction * startAction;
    QAction * quitAction;
    QMenu   * mediaMenu;
    QAction * addSongAction;

    QVBoxLayout     * mainLayout;
    PlaylistWidget  * playlistWidget;

	QLabel			* imageLabel;
	QPixmap			* logo;

    void initMenu ();
    void updateMenu ();

    void initMainLayout ();
    void updateGUI ();
	std::string extractFilename(std::string path);
};

#endif
